package com.rui.responsibility.model;

import com.rui.responsibility.obj.User;

/**
 * @Description: 登录校验，校验用户名是否匹配密码
 * @Author: ZhangRui
 * @Date: 2023/3/3 14:53
 * @Version: 1.0
 */
public class LoginHandler extends Handler {

    @Override
    public void doHandler(User user) {
        if (!"pyy52hz".equals(user.getUsername()) || !"123456".equals(user.getPassword())) {
            System.out.println("用户名或者密码不正确!请检查!");
            return;
        }
        user.setRole("admin");
        System.out.println("登陆成功!角色为管理员!");

        super.next.doHandler(user);
    }

}


